<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

namespace app\admin\model;

use think\Model;
use think\Db;

/**
 * 后台登录
 * @package app\admin\model
 */
class LoginModel extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'e_admin';
	
	/**
     * 后台登录
     * @param string $user_name 用户名
	 * @param string $password 密码
     * @author 郑义生 <1052063941@qq.com>
     * @return mixed
     */
	public function logining($input)
	{
		$where['password'] = md5($input['token'].$input['password']);
		$where['user_name'] = $input['user_name'];
		$admin = Db::name($this->table)->where($where)->find();
		return $admin;
	}

}
